home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / envtrim / envtrim.man < prev    next >
Text File  |  1996-07-10  |  2KB  |  62 lines

  1.                                 envtrim
  2.       Program to reset PARENT-process MS DOS environment variables
  3.  
  4.  
  5. USAGE
  6.     envtrim -{l|r}nn var [ -{l|r}nn var ]*
  7.  
  8.  
  9. FUNCTION
  10.  
  11.     envtrim trims from the left or right ("l" or "r") to a specified
  12.  count of characters ("nn") the value associated with environment
  13. variable  "var".   One or more environment variables can be truncated in
  14. a single  invocation of envtrim.  The environment variables in the
  15. PARENT process are  modified.
  16.  
  17.     For example, if the following environment variables are set
  18. at the root COMMAND.COM level as
  19.         USERNAME=jasmith
  20.         STATION=0000c0251af3
  21. then
  22.         envtrim -l3 username -r6 station
  23. results in
  24.         USERNAME=jas
  25.         STATION=251af3
  26.  
  27.     This capability is useful, for example, for truncating full Netware 
  28. username strings to 3-character strings used by network-aware programs such 
  29. as WordPerfect.  
  30.  
  31.  
  32. METHOD
  33.  
  34.     envtrim copies the environment block from the parent into local
  35. strings, modifies the strings, and copies the strings back to the
  36. parent's environment.  
  37.  
  38. ERROR CONDITIONS
  39.  
  40.     envtrim reports an error if switch letter is not preceeded by a
  41. '-', if the switch letter is not followed by a number, if an invalid
  42. switch letter is  entered, or if the environment variable whose value
  43. is  to be trimmed cannot be found in the working environment block.
  44.  
  45. LANGUAGE AND COMPATIBILITY
  46.  
  47.     envtrim is written in TURBOC for MS DOS computers.  It has been
  48. tested on DOS 3.3 and DOS 4.01.  Since it does not use DOS calls to
  49. effect the modifications (can't, since DOS provides no mechanism to
  50. modify the parent's environment), envtrim may not be compatible with
  51. future versions of DOS.
  52.  
  53. AUTHOR
  54.  
  55.     envtrim was written by H. D. Todd, Computing Center, Wesleyan
  56. University, December, 1990, using prototypes written by Douglas Bigelow,
  57. at the same address. envtrim is provided in source form and may be
  58. distributed freely providing author information is retained.  The author
  59. would appreciate receiving bug reports and copies of modifications and
  60. improvements (HDTodd@eagle.wesleyan.edu or HDTodd@wesleyan.bitnet).
  61.  
  62.